package com.lsx143.wordcount.day2;

import org.apache.flink.util.MathUtils;

public class MurmurTest {
    public static void main(String[] args) {
        String i1 = "奇数";
        String i0 = "偶数";
        int c1 = MathUtils.murmurHash(i1.hashCode()) % 128;
        int c0 = MathUtils.murmurHash(i0.hashCode()) % 128;
//        int i1 = 1;
//        int i0 = 0;
//        int c1 = MathUtils.murmurHash(Integer.hashCode(i1)) % 128;
//        int c0 = MathUtils.murmurHash(Integer.hashCode(i0)) % 128;
        System.out.println("1=>mur:" + c1);
        System.out.println("0=>mur:" + c0);
        int cc1 = c1 * 2 / 128;
        int cc0 = c0 * 2 / 128;
        System.out.println("1=>最终:" + cc1);
        System.out.println("0=>最终:" + cc0);
    }
}
